package com.health.ts.constant;
import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
 * 自定义分页
 * 由此对象将page对象转换成json对象，传到前台处理
 * 所以这个由这个中间对象来转换
 * @param <T>
 */
public class CustomPage<T>{
	
	//当前页数
	private Long pageNumber;
	
	//每页显示数量
	private Long pageSize;
	
	//总条数
	private Long  total;
	
	//数据列表
	private List<T> rows;
	
	//总页数
	private Long pages;
	

	public Long getPageNumber() {
		return pageNumber;
	}

	public void setPageNumber(Long pageNumber) {
		this.pageNumber = pageNumber;
	}

	public Long getPageSize() {
		return pageSize;
	}

	public void setPageSize(Long pageSize) {
		this.pageSize = pageSize;
	}

	public Long getPages() {
		return pages;
	}

	public void setPages(Long pages) {
		this.pages = pages;
	}

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	public Long getTotal() {
		return total;
	}

	public void setTotal(Long total) {
		this.total = total;
	}

	public CustomPage(){}
	
	public CustomPage(Page<T> page){
		this.pageNumber = page.getCurrent();
		this.pageSize = page.getSize();
		this.total = page.getTotal();
		this.rows = page.getRecords();
		this.pages = page.getPages();
	}
}
